from pydantic import BaseModel, Field
from typing import Optional


class DataPermissionRuleQuery(BaseModel):
    """数据权限规则查询参数"""
    page: int = Field(1, ge=1, description="页码")
    size: int = Field(10, ge=1, le=100, description="每页数量")
    name: Optional[str] = Field(None, description="规则名称")
    rule_code: Optional[str] = Field(None, description="规则编码")
    table_name: Optional[str] = Field(None, description="目标表名")
    condition_type: Optional[str] = Field(None, description="条件类型")
    status: Optional[bool] = Field(None, description="是否启用")


class RoleDataPermissionQuery(BaseModel):
    """角色数据权限关联查询参数"""
    page: int = Field(1, ge=1, description="页码")
    size: int = Field(10, ge=1, le=100, description="每页数量")
    role_id: Optional[int] = Field(None, description="角色ID")
    rule_id: Optional[int] = Field(None, description="规则ID")
    status: Optional[bool] = Field(None, description="是否启用")